﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AJWPFAdmin.Services.Migrations
{
    /// <inheritdoc />
    public partial class 新增黑名单车辆相关表适配德阳 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BlacklistedCars",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    CarNo = table.Column<string>(type: "varchar(120)", maxLength: 120, nullable: false, comment: "车牌号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PlateColor = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true, comment: "号牌颜色")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    VIN = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "车辆识别代码VIN")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    FuelTypeName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "燃料类型名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    EmissionStandard = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true, comment: "排放标准")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Reason = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "黑名单原因")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PId = table.Column<int>(type: "int", nullable: false),
                    CreateDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    UpdateDate = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BlacklistedCars", x => x.Id);
                },
                comment: "黑名单车辆记录表")
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BlacklistedCars");
        }
    }
}
